<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CompanyContactsCreateFamilyRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
	public function rules()
	{
		return [
			'house_id'			=> 'required',
			'realname'		=> 'required',
			'mobile'		=> 'required|size:11|unique:client_user_family,mobile',
//			'relationship'	=> 'required',
		];
	}
	
	public function messages(){
		return [
			'house_id.required'		=> '必须传入house_id',
			'realname.required'	=> '请填写业主姓名',
			'mobile.required'	=> '请填写手机号码',
			'mobile.numeric'	=> '手机号码格式错误',
			'mobile.unique'		=> '该手机号已被添加过',
			'mobile.size'		=> '手机号码暂只支持11位',
//			'relationship.required'		=> '请选择家属关系',
		];
	}
}
